﻿namespace QuailDashboard.View.Models
{
    /// <summary>
    /// The environment setting data model
    /// </summary>
    public class EnvironmentSettingData : Model
    {
        private string _name, _value;

        /// <summary>
        /// Initializes a new instance of the <see cref="EnvironmentSettingData"/> class.
        /// </summary>
        public EnvironmentSettingData()
            :this(string.Empty, string.Empty)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="EnvironmentSettingData"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        public EnvironmentSettingData(string name, string value)
        {
            _name = name;
            _value = value;
        }

        /// <summary>
        /// Gets or sets the setting name.
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                if (!string.Equals(_name, value))
                {
                    _name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        /// <summary>
        /// Gets or sets the setting value.
        /// </summary>
        public string Value
        {
            get
            {
                return _value;
            }

            set
            {
                if (!string.Equals(_value, value))
                {
                    _value = value;
                    NotifyPropertyChanged("Value");
                }
            }            
        }
    }
}
